﻿@using Windvoice.Blog
<div class="body-right">
    <div class="rightbox category">
        <div class="title">Categories</div>
        <ul class="list">
            @foreach(var cate in Category.FindAll())
            {
                <li>
                    <img src="/Content/images/cat-rss.gif" />
                    <a href="/blogs/@cate.UniqueKey">@cate.Name</a> 
                    <span>[@(Article.GetArticleCount(cate.ID))]</span>
                </li>
            }
        </ul>      
    </div>
    <div class="rightbox hotblog">
        <div class="title">Hot Blogs</div>
        <ul class="list">
            @{int i = 1;}
            @foreach (var article in Windvoice.Blog.Article.GetHotArticles(10))
            {
                <li class="@String.Format("ordinal{0}",i)"><span></span><a href="/blog/@article.UniqueKey" title="@article.Title">@article.Title</a></li>
                i++;
            }
        </ul>            
    </div>
    <div class="rightbox randomblog">
        <div class="title">Random Blogs</div>
        <ul class="list">
            @foreach (var article in Windvoice.Blog.Article.GetRandomArticles(10))
            {
                <li><span></span><a href="/blog/@article.UniqueKey" title="@article.Title">@article.Title</a></li>
            }
        </ul>            
    </div>
    <div class="rightbox comments">    
        <div class="title">New Comments</div>
        <ul class="list">
            @foreach (var comment in Comment.GetTopList(12))
            {
                var CommentUser = Windvoice.Authorize.User.Find(comment.UserID);
                var CommentBlog = Article.Find(comment.ArticleID);
                <li>
                    <div class="portrait">
                        <img src="@CommentUser.PortraitUrl" alt="@CommentUser.DisplayName" />
                        @CommentUser.DisplayName
                    </div>
                    <div class="word">
                        <a href="/blog/@(String.Format("{0}#comment{1}", CommentBlog.UniqueKey, @comment.ID))">@comment.Content</a>
                    </div>
                    <div class="clear"></div>
                </li>
            }
        </ul>       
    </div>
</div>